package com.schoolMall.service;

import com.schoolMall.domain.LocalAuth;
import com.schoolMall.dto.LocalAuthDto;
import com.schoolMall.exception.LocalAuthOperationException;

/**
 * @author:zyh
 * @Time:2021-09-03-17:13
 * @email:1269231889@qq.com
 */
public interface LocalAuthService {

    /**
     * 通过用户名和密码查询用户
     * @param username
     * @param password
     * @return
     */
    LocalAuth getLocalAuthByUsernameAndPwd(String username, String password);

    /**
     * 通过Id查询用户
     * @param userId
     * @return
     */
    LocalAuth getLocalAuthByUserId(long userId);

    /**
     * 绑定微信用户
     * @param localAuth
     * @return
     * @throws LocalAuthOperationException
     */
    LocalAuthDto bindLocalAuth(LocalAuth localAuth) throws LocalAuthOperationException;

    /**
     * 修改用户信息
     * @return
     * @throws LocalAuthOperationException
     */
    LocalAuthDto modifyLocalAuth(Long userId,String username,String password,String newPassword) throws LocalAuthOperationException;
}
